package com.wl.service;

import com.wl.pojo.Users;
import org.jose4j.lang.JoseException;

import javax.servlet.http.HttpServletRequest;
import java.io.UnsupportedEncodingException;
import java.util.Map;

/**
 * @program: treeHole
 * @author: 吴磊
 * @create: 2021-07-06 18:17
 */
public interface UsersService {
    /**
     * 检查用户是否已经注册人脸
     *
     * @param request
     * @return
     */
    boolean checkUserIsOwnerFace(HttpServletRequest request);

    /**
     * 人脸登录操作
     *
     * @param request
     */
    Map<String, Object> loginFaceOp(HttpServletRequest request);

    /**
     * 添加人脸操作
     *
     * @param request
     */
    int addFaceOp(HttpServletRequest request);


    boolean deleteUsersById(Users users);

    /**
     * 根据条件获取用户或者管理员或者全部
     *
     * @param request
     */
    Map<String, Object> getAllUserBySome(HttpServletRequest request);

    /**
     * 从Session中获取登录的管理员
     *
     * @param request
     */

    Map<String, Object> getAdmin(HttpServletRequest request);

    /**
     * 管理员退出
     *
     * @param request
     */
    boolean adminLoginOut(HttpServletRequest request);


    /**
     * 管理员登录
     *
     * @param request
     */
    Map<String, Object> adminLogin(HttpServletRequest request);

    /**
     * 检查用户修改密码的时候旧密码是否正确
     *
     * @param request
     */
    boolean checkUserPwdOp(HttpServletRequest request);


    /**
     * 登录
     *
     * @param userTelPhoneOrEmail
     * @param userPassword
     * @return
     * @throws JoseException
     * @throws UnsupportedEncodingException
     */
    Map<String, Object> login(String userTelPhoneOrEmail, String userPassword) throws JoseException, UnsupportedEncodingException;

    /**
     * 注册
     *
     * @param users
     * @return
     */
    Map<String, Object> register(Users users);

    /**
     * 更新用户信息
     *
     * @param users
     * @return
     */
    boolean update(Users users);

    /**
     * 退出登录
     *
     * @param request
     * @return
     */
    void loginOut(HttpServletRequest request);

    /**
     * 检查手机号或者邮箱是否已经被注册
     *
     * @param userTelephoneNumber
     * @return
     */
    boolean checkTelIsOkOp(String userTelephoneNumber);

    /**
     * 通过用户Id获取用户信息
     *
     * @param userId
     * @return
     */
    Users getUserById(String userId);
}
